home *** CD-ROM | disk | FTP | other *** search
- Palatino
- Apple Events
- Gizmos!
- Version 1.4
- Jens Peter Alfke
- 20 March 1995
- Apple Computer, Inc. 1991
- New York
- Palatino
- Apple Event Gizmos
- 20 March 1995
- Page
- Introduction
- OK, What Are They?
- AEGizmos
- );E consists of four libraries in one. These libraries provide alternate
- fFways of building and reading Apple events and Apple event descriptors.
- Courier
- AEBuild
- 6takes a format string
- a description in a very simple
- 7language of an Apple event descriptor
- and generates a
- <real descriptor (which could be a record or list or complete
- /Apple event) of arbitrary complexity out of it.
- AEPrint
- :does the reverse: given an Apple event descriptor, list or
- Arecord, it prettyprints it to a string. (The resulting string, if
- sent to
- AEBuild
- , would reproduce the original
- AEDesc
- structure.)
- AEStream
- 4provides a stream-based protocol that lets you build
- :descriptors and events in a linear fashion. The descriptor
- 1data stays all in one block and grows in discrete
- 5increments, so there will be far fewer Memory Manager
- calls.
- AESubDescriptors
- 8a high-efficiency way to examine and take apart (but not
- !modify) Apple Event descriptors (
- AEDesc
- structures).
- 7Almost everything is done in place, without any copying
- 7of data, which avoids most of the overhead of the Apple
- 8Event Manager. However, the API is very similar to that
- 2of the Apple Event Manager, which makes it easy to
- convert your code.
- f5Each library also has its own in-depth documentation.
- Palatino
- Apple Event Gizmos
- Page
- 20 March 1995
- s In It For Me?
- LFor many common tasks these libraries have clear advantages over the regular
- Apple Event API:
- Zapf Dingbats
- 7They run much faster when building complex descriptors.
- They use less heap space.
- DThey make your code smaller
- and easier to write
- by requiring fewer
- &calls to get things done. (Especially
- Courier
- AEBuild
- , which can often replace an
- r,entire page of code with one function call.)
- AEPrint
- )*?, which displays an Apple event or descriptor in human-readable
- r'form, can be very helpful in debugging.
- N*However, they do have their disadvantages:
- FThey
- re not first-class official Apple Computer products, and have not
- Lbeen formally tested. I do some testing on each release, and these libraries
- G being used in various projects at Apple (including AppleScript) and by
- r7third parties. On the whole they
- ve been very reliable.
- KThey don
- t provide all the functionality and flexibility of the Apple Event
- Manager. For instance,
- AEStream
- doesn
- t support random access.
- HThey
- re not as robust when given bad input. For instance, unlike the AEM
- ?they don
- t check for or disallow duplicate keywords in records.
- GThe 68k versions have to be linked into your code. Fortunately, they
- very small: even
- AEBuild
- )*/, the largest, is under 4k. (On PowerPC they
- rIprovided as a shared library. A shared library for 68k (CFM68K) is in the
- works.)
- N!Just How Stable Are They, Anyway?
- OThe Gizmos have been around for several years. In that period they
- ve been used
- Oin several projects inside and outside Apple. A couple of bugs have been found,
- Qwhich I
- ve tried to fix as soon as possible. By and large they seem to work fine.
- s some more detail:
- Palatino
- Apple Event Gizmos
- 20 March 1995
- Page
- fFI do some minimal testing of the code for each release; I verify that
- Courier
- AEBuild
- runs
- fLreliably on a moderately complex expression, produces exactly the same Apple
- Levent structure as does the original C code, and has no memory leakage. This
- also gives
- AEStream
- and
- AEPrint
- a good workout.
- AEBuild
- )*E has also been used in constructing test cases for the Object Support
- fOLibrary. These test cases built hideously complex descriptors with no problems.
- AEStream
- )00 is used in the AppleScript runtime engine. And
- AEBuild
- and
- AEPrint
- f5are being used in other Apple code, such as Ed Lai
- AESend
- tool, and in third
- party software.
- MThe sub-descriptors library was tested by creating an experimental version of
- AEPrint
- )*A that used it instead of the Apple Event Manager; it worked fine.
- f0Nonetheless, see the disclaimer presented below.
- s always possible for new bugs to be introduced with each release. If you find
- Sproblems, first try to revert to an earlier release (check previous developer CDs.)
- IAlso make sure to notify me of the problem so I can fix it! My AppleLink
- address is
- Monaco
- , and my Internet address is
- Jens_Alfke@powertalk.apple.com
- Version History
- 3/20/95
- )H7Added ability to use AESubDescs on entire Apple Events.
- 5Added AECopySubDescData. Fixed several bugs. Released
- 5more configurations of the CodeWarrior 68k libraries.
- 1.3.4
- 6/1/94
- )H1Now includes PowerPC libraries. No other changes.
- 1.3.3
- 10/??/93
- )H.Restored floating-point formatting to AEPrint.
- 1.3.2
- 9/29/93
- )H4AESubDescToDesc now works properly when the wantType
- 3is typeWildCard. (This used to result in an error.)
- AEPrint no longer uses the
- <stdio>
- library. Unfortunately,
- 7this means floating point numbers don
- t display nicely.
- Added
- -model far
- versions of the MPW libraries.
- 1.3.1
- 7/7/93
- )H7Streams consisting of only a single simple (non-nested)
- ,descriptor are no longer incorrectly padded.
- and that
- s as far back as the version history goes.
- Palatino
- Apple Event Gizmos
- Page
- 20 March 1995
- Disclaimer
- OFTWARE
- AINSTAKINGLY
- ESTED
- UTHLESSLY
- FFICIENT
- UALITY
- NGINEERS
- EITHER
- PPLE
- OMPUTER
- NCORPORATED
- OR THE
- UTHOR OF
- OFTWARE
- EGALLY
- INDING
- LAIM
- OFTWARE
- SE AT
- AVE A
- >+.8,
- =3-A@2
- !("9U
- p 0p`P
- =?7,<.
- xP(H`X
- temp.0001
- Jens Alfke
- Apple Computer
- Microsoft Word
- New York
- Monaco
- Zapf Dingbats
- Palatino
- Courier
- bPREC
- nPRVS
- zCAPN
-